package com.ruoyi.hospital.service.shop.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.shop.ShopProductCategoryMapper;
import com.ruoyi.hospital.domain.shop.ShopProductCategory;
import com.ruoyi.hospital.service.shop.IShopProductCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-16
 */
@Service
public class ShopProductCategoryServiceImpl implements IShopProductCategoryService 
{
    @Autowired
    private ShopProductCategoryMapper shopProductCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public ShopProductCategory selectShopProductCategoryById(Integer id)
    {
        return shopProductCategoryMapper.selectShopProductCategoryById(id);
    }

    /**
     * 查询商品分类列表
     * 
     * @param shopProductCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<ShopProductCategory> selectShopProductCategoryList(ShopProductCategory shopProductCategory)
    {
        return shopProductCategoryMapper.selectShopProductCategoryList(shopProductCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param shopProductCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertShopProductCategory(ShopProductCategory shopProductCategory)
    {
        shopProductCategory.setCreateTime(DateUtils.getNowTimeSecond());
        return shopProductCategoryMapper.insertShopProductCategory(shopProductCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param shopProductCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateShopProductCategory(ShopProductCategory shopProductCategory)
    {
        shopProductCategory.setUpdateTime(DateUtils.getNowTimeSecond());
        return shopProductCategoryMapper.updateShopProductCategory(shopProductCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteShopProductCategoryByIds(Integer[] ids)
    {
        return shopProductCategoryMapper.deleteShopProductCategoryByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteShopProductCategoryById(Integer id)
    {
        return shopProductCategoryMapper.deleteShopProductCategoryById(id);
    }
}
